 {
        
        var o = require("./UISoundManager.js"), i = require("./UIPopupBase.js");
        cc.Class({
            extends: i,
            properties: {
                btns: {
                    default: null,
                    type: cc.Node
                },
                labelText: {
                    default: null,
                    type: cc.Label
                }
            },
            init: function () {
                this.nodeBigPrize = Global.utils.searchNode(this.node, "inviteBigPrize");
            },
            onLoad: function () {
                Global.notificationCenter.on(Global.eventName.MSG_POPUPDATA_INVITE_FRIEND, this.onPulled_InviteFriendData.bind(this), this),
                    Global.notificationCenter.on(Global.eventName.MSG_INVITE_FRIEND_ALL_PRIZE, this.onPulled_AllPrizeData.bind(this), this),
                    Global.notificationCenter.on(Global.eventName.MSG_INVITE_FRIEND_BIG_PRIZE, this.onPulled_BigPrizeData.bind(this), this),
                    Global.notificationCenter.on(Global.eventName.MSG_SET_NODERECEIVE_ACTIVE, this.setNodeReceiveActive.bind(this), this),
                    this.grims = this.btns.children, this.inviteLimit = this.grims.length, this.contentText = "邀好友进游戏得金币，满" + this.inviteLimit + "位好友额外得惊喜礼包！";
                var e = Global.eventName.CMD_INVITE_FRIEND;
                this.userId = Global.userProfile.getUserId(), Global.msgHandler.requestInviteFri(e, this.userId);
            },
            onPulled_InviteFriendData: function (e) {
                this.inviteRewards = e.inviteRewards, this.currentIndex = e.currentIndex, this.headUrlArr = e.headUrlArr,
                    this.isGotBigPrize = e.isGotBigPrize, this.prizeArr = [];
                for (var t = 0; t < this.inviteRewards.length; t++) this.prizeArr.push(this.inviteRewards[t].count);
                this.setData();
            },
            setData: function () {
                for (var e = 0; e < this.grims.length; e++) {
                    (n = Global.utils.searchNode(this.grims[e], "nodeHead")).active = !1, this.setNodeReceiveActive({
                        parent: this.grims[e],
                        active: !1
                    }), Global.utils.searchNode(this.grims[e], "prize").getComponent(cc.Label).string = this.prizeArr[e] + "金币";
                }
                for (var t = 0; t < this.headUrlArr.length; t++) {
                    var n, o = (n = Global.utils.searchNode(this.grims[t], "nodeHead")).getComponent("HeadController");
                    o && o.bindData(this.headUrlArr[t]), n.active = !0, t <= this.currentIndex && this.setNodeReceiveActive({
                        parent: this.grims[t],
                        active: !0
                    });
                }
                this.setNodeReceiveActive({
                    parent: this.nodeBigPrize,
                    active: this.isGotBigPrize
                });
            },
            setNodeReceiveActive: function (e) {
                var t = e.parent, n = e.active;
                Global.utils.searchNode(t, "receivedSp").active = n;
            },
            onInviteClick: function (e) {
                console.log("onInviteClick"), o.playEffect("select");
                var t = {
                    inviteFriReward: 1,
                    userId: this.userId
                }, n = JSON.stringify(t), i = {
                    share_type: Global.config.sharePointId.rewardInvite
                };
                tywx.PropagateInterface.getWeightShareConfigInfoByTypeWithShare(i, n, function (e) {
                    console.log("分享成功");
                });
            },
            onPulled_AllPrizeData: function (e) {
                var t = this;
                if (e) if (e.error) {
                    if (console.log("onPulled_AllPrizeData error code:", e.error, e.error.code), 0 == e.error.code) {
                        var n = {
                            text: e.error.info,
                            confirmText: "确定",
                            confirmSp: Global.spriteAtlas.getOKSpf()
                        };
                        Global.UIPopupManager.alert(n);
                    } else if (1 == e.error.code) {
                        var o = {
                            text: e.error.info,
                            cancelText: "邀请好友",
                            cancelSp: Global.spriteAtlas.getGoInviteSpf(),
                            cancelCallback: function () {
                                t.onInviteClick();
                            },
                            closeCallback: function () {
                                console.log("closeCallback");
                            },
                            needConfirmBtn: !1
                        };
                        Global.UIPopupManager.alert(o);
                    }
                } else if (e.result && e.result.rewards && e.result.rewards.length > 0) {
                    for (var i = this, a = function () {
                        for (var t = 0; t < i.getGrims().length; t++) t <= e.result.rewardIndex && Global.notificationCenter.emit(Global.eventName.MSG_SET_NODERECEIVE_ACTIVE, {
                            parent: i.getGrims()[t],
                            active: !0
                        });
                    }.bind(this), r = e.result.rewards, s = 0, l = 0; l < r.length; l++) s += r[l].count;
                    var c = {
                        reward: s,
                        name: "金币",
                        type: "inviteFriReward"
                    };
                    Global.UIPopupManager.addPopup("PopupPanel/Panel_shareGroup_Reward", function (e) {
                        e.getComponent("shareGroup_RewardPanel").setData(c, a), Global.spriteAtlas.setSpriteFrame(e.getComponent("shareGroup_RewardPanel").rewardSp, "Texture/Rewards", "WP_3");
                    });
                }
            },
            onGetAllClick: function () {
                console.log("onGetAllClick"), o.playEffect("select");
                var e = Global.eventName.CMD_INVITE_FRIEND;
                Global.msgHandler.requestInviteFri(e, this.userId);
                e = Global.eventName.CMD_INVITE_FRIEND_ALL_PRIZE;
                Global.msgHandler.requestInviteFri(e, this.userId);
            },
            onPulled_BigPrizeData: function (e) {
                if (e) if (e.error) {
                    console.log("onPulled_AllPrizeData error code:", e.error.code);
                    var t = {
                        text: e.error.info,
                        confirmText: "确定",
                        confirmSp: Global.spriteAtlas.getOKSpf(),
                        needCloseBtn: !1
                    };
                    Global.UIPopupManager.alert(t);
                } else if (e.result && e.result.rewards && e.result.rewards.length > 0 && !this.isGotBigPrize) {
                    for (var n = this, o = function () {
                        var e = n.getNodeBigPrize();
                        Global.notificationCenter.emit(Global.eventName.MSG_SET_NODERECEIVE_ACTIVE, {
                            parent: e,
                            active: !0
                        }), n.setIsGotBigPrize(!0);
                    }.bind(this), i = e.result.rewards, a = 0, r = 0; r < i.length; r++) a += i[r].count;
                    var s = {
                        reward: a,
                        name: "金币",
                        type: "inviteFriReward"
                    };
                    Global.UIPopupManager.addPopup("PopupPanel/Panel_shareGroup_Reward", function (e) {
                        e.getComponent("shareGroup_RewardPanel").setData(s, o), Global.spriteAtlas.setSpriteFrame(e.getComponent("shareGroup_RewardPanel").rewardSp, "Texture/Rewards", "WP_3");
                    });
                }
            },
            onBigPrizeClick: function () {
                if (console.log("onBigPrizeClick"), !this.isGotBigPrize) {
                    o.playEffect("select");
                    var e = Global.eventName.CMD_INVITE_FRIEND_BIG_PRIZE;
                    Global.msgHandler.requestInviteFri(e, this.userId);
                }
            },
            OnPanelClose: function () {
                o.playEffect("select"), this.closePanel();
            },
            getGrims: function () {
                return this.grims;
            },
            getNodeBigPrize: function () {
                return this.nodeBigPrize;
            },
            setIsGotBigPrize: function (e) {
                this.isGotBigPrize = e;
            },
            getIsGotBigPrize: function () {
                return this.isGotBigPrize;
            }
        })
    }